package com.example.prom.ok.y2022.controller.email.common.enums;

import lombok.Getter;

@Getter
public enum CommonEmailEum {
    BOUNCE("Bounce","邮件被退回"),
    OPEN("Open","收件人已打开 HTML 邮件"),
    CLICK("Click","收件人单击了邮件中的链接"),

    /* -------------- sendgrid邮件状态码 -------------- */
    // 投递事件
    PROCESSED("Processed","消息已收到并准备发送"),
    DROPPED("Dropped","消息已被丢弃。可能的原因：无效的SMTPAPI标头、垃圾邮件内容、取消订阅的地址、退回的地址、垃圾邮件报告地址、收件人列表超过package配额"),
    DELIVERED("Delivered","消息已投递"),
    DEFERRED("Deferred","接收服务器暂时拒绝了该消息"),
    BLOCKED("Blocked","接收服务器暂时不能或不会接受该消息"),
    FAILED("Failed","投递失败"),

    // 用户行为事件
    SPAM_REPORT("Spam Report","收件人将邮件标记为垃圾邮件"),
    UNSUBSCRIBE("Unsubscribe","退订"),
    GROUP_UNSUBSCRIBE("Group Unsubscribe","群组退订"),
    GROUP_RESUBSCRIBE("Group Resubscribe","群组重新订阅"),

    /* -------------- aws邮件状态码 -------------- */
    COMPLAINT("Complaint","投诉"),
    DELIVERY("Delivery","送达"),
    SEND("Send","发送"),
    REJECT("Reject","拒绝"),
    RENDERING_FAILURE("Rendering Failure","呈现失败"),
    DELIVERYDELAY("DeliveryDelay","延迟送达"),
    SUBSCRIPTION("Subscription","订阅"),
    /* -------------- 如果以上错误码都没找到，则用来兜底 -------------- */
    OTHER("Other","其他错误"),

    ;
    CommonEmailEum(String type, String desc){
        this.type = type;
        this.desc = desc;
    }
    private String type;
    private String desc;
}
